/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rationalsheet.parser.operation.function;

import org.rationalsheet.parser.type.Type;

/**
 *
 * @author Overmind
 */
public abstract class Function2Arguments<R, A1, A2>
    extends Function
{

    public Function2Arguments(String name, Type resultType, 
            Type arg1Type, Type arg2Type)
    {
        super(name, resultType, new Type[]
            {arg1Type, arg2Type});
    }

    @Override
    protected Object calculateOfObjects(Object[] arguments)
    {
        return calculate((A1)arguments[0], (A2)arguments[1]);
    }
    
    public abstract R calculate(A1 arg1, A2 arg2);

}
